<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<form method="post" class="form-horizontal js-ajax-form margin-top-20">
			<div class="form-group">
				<label for="input-no" class="col-sm-2 control-label"><span class="form-required">*</span>产品编号</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-no" readonly value="{$result.id}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-company" class="col-sm-2 control-label"><span class="form-required">*</span>公司名称</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-company" required name="company" value="{$result.company}">
				</div>
			</div>
			<div class="form-group">
				<label for="second_cate" class="col-sm-2 control-label"><span class="form-required">*</span>行业类别</label>
				<div class="col-md-6 col-sm-10">
					<div class="col-xs-6">
						<div class="row">
							<select class="form-control" name="category" id="first_cate">
								<volist name="catelist" id="vo">
									<eq name="vo.name" value="其他">
										<else/>
										<option  value="{$vo.id}" <eq name="vo.id " value="$cateinfo['parent_id']">selected</eq> > {$vo.name} </option>
									</eq>
								</volist>
							</select>
						</div>
					</div>
					<div class="col-xs-6">
						<div class="row">
							<select class="form-control" name="cid" id="second_cate">
								<volist name="parentcateinfo" id="vo">
									<option  value="{$vo.id}" <eq name="vo.id " value="$result.cid">selected</eq> > {$vo.name} </option>
								</volist>
							</select>
						</div>
					</div>
				</div>
			</div>
			<div class="form-group">
				<label for="input-corporation" class="col-sm-2 control-label"><span class="form-required">*</span>法人代表</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-corporation" required name="corporation" value="{$result.corporation}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-registered_capital" class="col-sm-2 control-label"><span class="form-required">*</span>注册资金</label>
				<div class="col-md-6 col-sm-10 input-group" style="padding: 0 15px;">
					<input type="number" class="form-control" id="input-registered_capital" required name="registered_capital" value="{$result.registered_capital}">
					<span class="input-group-addon">万元</span>
				</div>
			</div>
			<div class="form-group">
				<label for="input-currency" class="col-sm-2 control-label"><span class="form-required">*</span>货币种类</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" required value="{$result.currname}"
						   placeholder="请选择币种" onclick="doSelectLayerApi(this);" data-is_full="true"
						   data-url="{:url('/api/resource/currency/select_h5')}" data-id="input-currency" name="layer_temp[2]"
						   readonly/>
					<input class="form-control" type="hidden" value="{$result.currency}" name="currency"
						   id="input-currency"/>
				</div>
			</div>
			<div class="form-group">
				<label for="input-regtime" class="col-sm-2 control-label"><span class="form-required">*</span>成立日期</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" required max="{:date('Y-m-d')}" type="date" name="regtime" id="input-regtime"
						   value="{$result.regtime|date='Y-m-d',###}">
				</div>
			</div>
			<div class="form-group">
				<label for="select-area" class="col-sm-2 control-label"><span class="form-required">*</span>注册地区</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" id="select-area" name="area" required>
						<volist name="areaslist" id="vo">
							<option value="{$vo.areaid}" <eq name="vo.areaid" value="$result['area']">selected</eq> >{$vo.name}</option>
						</volist>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label for="input-address" class="col-sm-2 control-label">注册地址</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-address" name="address" value="{$result.address}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-business" class="col-sm-2 control-label">主营业务</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-business" name="business" value="{$result.business}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-phone" class="col-sm-2 control-label"><span class="form-required">*</span>联系电话</label>
				<div class="col-md-6 col-sm-10">
					<input type="tel" class="form-control" id="input-phone" required name="phone" value="{$result.phone}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-email" class="col-sm-2 control-label"><span class="form-required">*</span>邮箱</label>
				<div class="col-md-6 col-sm-10">
					<input type="email" class="form-control" id="input-email" required name="email" value="{$result.email}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-situation" class="col-sm-2 control-label"><span class="form-required">*</span>公司情况</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-situation" required name="situation" value="{$result.situation}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-manager" class="col-sm-2 control-label"><span class="form-required">*</span>负责人</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" required value="{$result.sname}"
						   placeholder="请选择负责人" onclick="doSelectLayerApi(this);" data-is_full="true"
						   data-url="{:url('/api/department/user/select_h5')}" data-id="input-manager" name="layer_temp[3]"
						   readonly/>
					<input class="form-control" type="hidden" value="{$result.manager}" name="manager"
						   id="input-manager"/>
				</div>
			</div>
			<div class="form-group">
				<label for="input-createtime" class="col-sm-2 control-label">录入时间</label>
				<div class="col-md-6 col-sm-10">
					<input type="datetime-local" class="form-control" id="input-createtime" max="{:date('Y-m-d\\TH:i')}" value="{$result.createtime|date='Y-m-d\\TH:i',###}" required name="createtime">
				</div>
			</div>
			<div class="form-group">
				<label for="input-record_type" class="col-sm-2 control-label">备案类型</label>
				<div class="col-md-6 col-sm-10">
					<input class="radio-inline" type="radio" value="1" name="record_type" <eq name="result.record_type" value="1">checked</eq> > 区域
					<input class="radio-inline" type="radio" value="2" name="record_type" <eq name="result.record_type" value="2">checked</eq> > 全国
				</div>
			</div>
			<div class="form-group">
				<label for="input-record_time" class="col-sm-2 control-label">备案时间</label>
				<div class="col-md-6 col-sm-10">
					<input type="date" class="form-control" id="input-record_time" max="{:date('Y-m-d')}" value="{$result.record_time|date='Y-m-d',###}" required name="record_time">
				</div>
			</div>
			<div class="form-group">
				<label for="input-nature" class="col-sm-2 control-label"><span class="form-required">*</span>客户性质</label>
				<div class="col-md-6 col-sm-10">
					<input class="form-control" type="text" required value="{$result.nature_name|default=''}"
						   placeholder="请选择客户性质" onclick="doSelectLayerApi(this);" data-is_full="true"
						   data-url="{:url('/api/resource/cate/select_h5',['type'=>1])}" data-id="input-nature" name="layer_temp[4]"
						   readonly/>
					<input class="form-control" type="hidden" value="{$result.nature}" name="nature"
						   id="input-nature"/>
				</div>
			</div>
			<div class="form-group">
				<label for="input-price" class="col-sm-2 control-label">价格</label>
				<div class="col-md-6 col-sm-10" style="padding: 0 15px;">
					<div class=" input-group">
						<span class="input-group-addon">¥</span>
						<input type="number" class="form-control" id="input-price" name="price" value="{$result.price}">
						<span class="input-group-addon">万元</span>
					</div>
					<p class="help-block">（两位小数）</p>
				</div>
			</div>
			<div class="form-group">
				<label for="textarea-remark" class="col-sm-2 control-label">备注</label>
				<div class="col-md-6 col-sm-10">
					<textarea name="remark" class="form-control" id="textarea-remark" rows="3">{$result.remark}</textarea>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="{$result.id}" />
					<button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
				</div>
			</div>
		</form>
	</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#first_cate").change(function(){
			var selected_id = $("#first_cate").val();
			$.ajax({
                url:"{:url('/api/business/cate/lists')}",
                headers:{
                    'XX-Token': header.token,
                    'XX-Device-Type': header.device
                },
				data: {id : selected_id},
				async:true,
				type:'GET',
				contentType:"application/json",
				dataType:"json",
				success:function(data){
					if(data.code > 20000 && data.code <30000) {
						logout();
					}
					$('#second_cate').html("");
					$.each(data,function (k,p){
						$('#second_cate').append('<option value="'+p.id+'">'+p.name+'</option>');
					});
				}
			})
		});
	});
</script>
</body>
</html>